# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Wesley Moore <wes@wezm.net>

pkgname=eva
pkgver=0.3.1
pkgrel=1
pkgdesc='simple calculator REPL, similar to bc(1)'
arch=(loong64 x86_64)
url="https://github.com/nerdypepper/$pkgname"
license=(GPL3)
depends=(gcc-libs)
makedepends=(cargo)
options=(debug)
_archive="$pkgname-$pkgver"
source=("$url/archive/v$pkgver/$_archive.tar.gz")
sha256sums=('d6a6eb8e0d46de1fea9bd00c361bd7955fcd7cc8f3310b786aad48c1dce7b3f7')

prepare() {
	cd "$_archive"
	cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
	cd "$_archive"
	cargo build --frozen --release
}

check() {
	cd "$_archive"
	cargo test --frozen
}

package() {
	cd "$_archive"
	install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
}
